package cn.wolfcode.springboot_consumer.component;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "01-springboot",
        consumerGroup = "springboot-consumer",
        messageModel = MessageModel.BROADCASTING,//演示消费模式
        selectorExpression = "age > 20",
        selectorType = SelectorType.SQL92
)
public class Consumer implements RocketMQListener<String>{

    @Override
    public void onMessage(String msg) {
        System.out.println("消费者0消费的内容是："+msg);
    }
}
